/* WHALES — Institutional Cinematic Auth Suite (Living Dark Environment, No Static AI Wallpaper) */
html:has(.wl-root), body:has(.wl-root) { 
  margin: 0; 
  height: 100%; 
  background: #020712; 
}

body:has(.wl-root) > .topbar,
body:has(.wl-root) > .mobile-menu-panel,
body:has(.wl-root) > .skip-link,
body:has(.wl-root) .wcc-foot {
  display: none !important;
}

.wl-root {
  position: fixed; 
  inset: 0; 
  width: 100vw; 
  height: 100vh; 
  height: 100dvh; 
  overflow-x: hidden; 
  overflow-y: auto;
  z-index: 100;
  background: #020712;
  color: #eaf6ff;
  display: flex;
  flex-direction: column;
}

/* Custom sleek scrollbar */
.wl-root::-webkit-scrollbar {
  width: 5px;
}
.wl-root::-webkit-scrollbar-track {
  background: rgba(2, 6, 13, 0.7);
}
.wl-root::-webkit-scrollbar-thumb {
  background: rgba(0, 174, 255, 0.35);
  border-radius: 3px;
}
.wl-root::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 174, 255, 0.7);
}

/* ==========================================================================
   LIVING INSTITUTIONAL ENVIRONMENT (VIDEO + CANVAS + SVG MATRIX)
   ========================================================================== */
.wl-bg-media {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.wl-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.26;
  filter: brightness(0.68) contrast(1.25) saturate(1.1);
}

.wl-video-scrim {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 65% 65% at 50% 50%, rgba(2, 8, 19, 0.42) 0%, rgba(1, 5, 12, 0.88) 72%, #01040a 100%),
    linear-gradient(180deg, rgba(1, 4, 10, 0.75) 0%, transparent 22%, transparent 78%, rgba(1, 4, 10, 0.85) 100%);
}

.wl-ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.wl-grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: 
    linear-gradient(to right, rgba(0, 174, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 174, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, #000 35%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, #000 35%, transparent 85%);
}

.wl-radar-rings {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  height: min(720px, 92vw);
  pointer-events: none;
  z-index: 1;
  border-radius: 50%;
  border: 1px dashed rgba(0, 174, 255, 0.07);
  animation: wl-spin 90s linear infinite;
}

.wl-radar-rings::before {
  content: "";
  position: absolute;
  inset: 60px;
  border-radius: 50%;
  border: 1px solid rgba(0, 174, 255, 0.04);
}

.wl-ambient-aura {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 94vw);
  height: min(700px, 90vh);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 170, 255, 0.14) 0%, rgba(0, 100, 220, 0.05) 45%, transparent 70%);
  filter: blur(52px);
  pointer-events: none;
  z-index: 1;
  animation: wl-breathe 7s ease-in-out infinite;
}

/* ==========================================================================
   TOPBAR: Sleek Floating Glass Header (Derived from card glassmorphism)
   ========================================================================== */
.wl-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3.5vw, 44px);
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(2, 8, 18, 0.92) 0%, rgba(2, 8, 18, 0.75) 75%, transparent 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.wl-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: #fff;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.wl-brand-link:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.wl-brand-mini-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(47, 212, 255, 0.75));
}

.wl-brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.wl-brand-name {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fff;
  font-family: var(--whales-font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.wl-brand-tag {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #00e5ff;
  font-family: var(--whales-font-mono, monospace);
}

.wl-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wl-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 11px;
  background: rgba(3, 18, 34, 0.78);
  border: 1px solid rgba(0, 174, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #d6ecff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.wl-action-btn:hover {
  background: rgba(4, 26, 48, 0.92);
  border-color: rgba(47, 212, 255, 0.8);
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 170, 255, 0.35), 0 4px 14px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}
.wl-action-btn i {
  font-size: 0.82rem;
  color: #2fd4ff;
}

[dir="rtl"] .wl-rtl-flip {
  transform: scaleX(-1);
}

/* ==========================================================================
   CENTER WRAPPER
   ========================================================================== */
.wl-center { 
  position: relative; 
  z-index: 2; 
  min-height: 100%; 
  display: flex; 
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: clamp(60px, 8vh, 76px) 16px clamp(44px, 6vh, 58px); 
  box-sizing: border-box; 
  width: 100%;
}

/* ==========================================================================
   CARD: UNMODIFIED ORIGINAL LOGIN CARD CORE
   ========================================================================== */
.wl-card {
  position: relative; 
  width: clamp(310px, 24vw, 410px); 
  max-width: 100%;
  box-sizing: border-box;
  margin-block: auto;
  padding: clamp(14px, 2.4vh, 28px) clamp(20px, 1.8vw, 30px);
  background: rgba(3, 18, 34, .84); 
  border: 1px solid rgba(0, 174, 255, .35); 
  border-radius: 20px;
  backdrop-filter: blur(14px); 
  -webkit-backdrop-filter: blur(14px);
  animation: wl-glow 6s ease-in-out infinite; 
  text-align: start;
}

/* Synchronized Registration Card Modifier */
.wl-card--register {
  width: clamp(340px, 31vw, 470px);
  padding: clamp(14px, 2vh, 22px) clamp(18px, 2vw, 28px);
}

@property --wl-a { 
  syntax: "<angle>"; 
  inherits: false; 
  initial-value: 0deg; 
}

.wl-beam {
  position: absolute; 
  inset: -1px; 
  border-radius: 21px; 
  padding: 1.5px; 
  pointer-events: none;
  background: conic-gradient(from var(--wl-a), transparent 0deg, transparent 290deg, rgba(0, 120, 255, .5) 320deg, #7fe9ff 352deg, #fff 358deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; 
  mask-composite: exclude;
  filter: drop-shadow(0 0 6px rgba(47, 212, 255, .9));
  animation: wl-spin 5.5s linear infinite; 
}

@keyframes wl-spin { 
  to { --wl-a: 360deg; } 
}

@keyframes wl-glow {
  0%, 100% { box-shadow: 0 0 30px rgba(0, 140, 255, .14), 0 20px 60px rgba(0, 0, 0, .5); }
  50% { box-shadow: 0 0 48px rgba(0, 150, 255, .28), 0 20px 60px rgba(0, 0, 0, .5); }
}

@keyframes wl-breathe { 
  0%, 100% { opacity: .2; } 
  50% { opacity: .45; } 
}

.wl-logo { 
  display: flex; 
  justify-content: center; 
  margin-bottom: clamp(4px, 1vh, 12px); 
}

.wl-logo img { 
  height: clamp(40px, 7vh, 64px); 
  width: auto;
  filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(47, 212, 255, .6)); 
  animation: wl-logo 5s ease-in-out infinite; 
}

@keyframes wl-logo {
  0%, 100% { filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(47, 212, 255, .4)); }
  50% { filter: brightness(0) invert(1) drop-shadow(0 0 16px rgba(47, 212, 255, .85)); }
}

.wl-card h1 { 
  margin: 0; 
  text-align: center; 
  font-size: clamp(1.2rem, 2.6vh, 1.55rem); 
  font-weight: 700; 
  color: #fff; 
}

.wl-card .wl-hint { 
  margin: 4px 0 clamp(10px, 1.8vh, 18px); 
  text-align: center; 
  font-size: .84rem; 
  color: rgba(200, 225, 245, .7); 
}

/* Explicit Form Rules to Overwrite Any External 2-Column Rules */
.auth-page main.wl-root #auth-form,
.auth-page main[data-register-basic].wl-root #auth-form,
.wl-root .wl-card form#auth-form,
.wl-card form { 
  display: flex !important; 
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: clamp(9px, 1.3vh, 13px) !important; 
  margin: 0 !important; 
  width: 100% !important;
}

.auth-page main[data-register-basic].wl-root #auth-form > .field,
.wl-root .wl-card form#auth-form > .field,
.wl-card .field { 
  margin: 0 !important; 
  width: 100% !important;
  min-inline-size: 0 !important;
}

.wl-card .field label { 
  display: block; 
  font-size: .8rem; 
  margin-bottom: 5px; 
  color: rgba(215, 235, 250, .85); 
}

.wl-card .field input[type=email], 
.wl-card .field input[type=password], 
.wl-card .field input[type=text],
.wl-card .field input[type=tel] {
  width: 100%; 
  box-sizing: border-box; 
  height: clamp(38px, 5.2vh, 46px); 
  padding: 0 12px; 
  border-radius: 11px;
  background: rgba(1, 10, 22, .7) !important; 
  border: 1px solid rgba(90, 160, 220, .25) !important; 
  color: #fff !important;
  font: inherit; 
  font-size: .9rem; 
  outline: 0; 
  transition: border-color .2s, box-shadow .2s;
}

.wl-card .field input:focus { 
  border-color: rgba(47, 212, 255, .8) !important;
  box-shadow: 0 0 0 3px rgba(0, 170, 255, .15), 0 0 16px rgba(0, 170, 255, .25) !important; 
}

.wl-card .password-control { 
  position: relative; 
  display: block; 
}

.wl-card .password-control input { 
  padding-inline-end: 44px !important; 
}

.wl-card .password-control .icon-btn { 
  position: absolute; 
  inset-inline-end: 6px; 
  top: 50%; 
  transform: translateY(-50%);
  width: 32px; 
  height: 32px; 
  display: grid; 
  place-items: center; 
  background: none; 
  border: 0; 
  color: rgba(200, 225, 245, .75); 
  cursor: pointer; 
}

.wl-card .password-control .icon-btn svg { 
  width: 18px; 
  height: 18px; 
}

.wl-card .invalid-feedback { 
  color: #ff7a8a; 
  font-size: .75rem; 
  margin-top: 4px; 
}

.wl-card .invalid-feedback:empty { 
  display: none; 
}

.wl-row { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  gap: 8px; 
  font-size: .8rem; 
}

.wl-card .checkbox-label { 
  display: inline-flex; 
  gap: 6px; 
  align-items: center; 
  cursor: pointer; 
  margin: 0; 
  color: rgba(215, 235, 250, .85); 
}

.wl-card .checkbox-label input { 
  accent-color: #19b8ff; 
}

.wl-card a { 
  color: #5fd3ff; 
  text-decoration: none; 
}

.wl-card a:hover { 
  text-decoration: underline; 
}

.wl-card button[type=submit] {
  position: relative; 
  overflow: hidden; 
  width: 100%; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  gap: 10px;
  height: clamp(40px, 5.6vh, 48px); 
  border: 0; 
  border-radius: 11px; 
  cursor: pointer; 
  color: #fff; 
  font: inherit; 
  font-weight: 700; 
  font-size: .95rem;
  background: linear-gradient(135deg, #0a6cff, #14b8ff); 
  box-shadow: 0 8px 24px rgba(0, 120, 255, .35);
}

.wl-card button[type=submit] svg { 
  width: 18px; 
  height: 18px; 
}

.wl-card button[type=submit]::after { 
  content: ""; 
  position: absolute; 
  inset: 0; 
  transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  animation: wl-shine 4.5s ease-in-out infinite; 
  pointer-events: none; 
}

@keyframes wl-shine { 
  0%, 60% { transform: translateX(-120%); } 
  100% { transform: translateX(120%); } 
}

.wl-divider { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  margin: clamp(8px, 1.4vh, 15px) 0; 
  font-size: .75rem; 
  color: rgba(190, 215, 235, .55); 
}

.wl-divider::before, 
.wl-divider::after { 
  content: ""; 
  flex: 1; 
  height: 1px; 
  background: rgba(120, 180, 230, .2); 
}

.wl-card .auth-footer { 
  display: flex; 
  justify-content: center; 
  gap: 6px; 
  flex-wrap: wrap; 
  font-size: .85rem; 
  color: rgba(210, 230, 245, .75); 
  margin: 0; 
}

.wl-card .auth-footer a { 
  font-weight: 700; 
}

/* ==========================================================================
   PERFECTED REGISTRATION STYLES: Balanced, Symmetrical & Robust
   ========================================================================== */
.wl-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.wl-select-wrap select {
  width: 100%;
  box-sizing: border-box;
  height: clamp(38px, 5.2vh, 46px);
  padding: 0 36px 0 12px;
  border-radius: 11px;
  background: rgba(1, 10, 22, .7) !important;
  border: 1px solid rgba(90, 160, 220, .25) !important;
  color: #fff !important;
  font: inherit;
  font-size: .88rem;
  outline: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .2s, box-shadow .2s;
}

[dir="rtl"] .wl-select-wrap select {
  padding: 0 12px 0 36px;
}

.wl-select-wrap select:focus {
  border-color: rgba(47, 212, 255, .8) !important;
  box-shadow: 0 0 0 3px rgba(0, 170, 255, .15), 0 0 16px rgba(0, 170, 255, .25) !important;
}

.wl-select-wrap select option {
  background: #031224 !important;
  color: #fff !important;
  padding: 8px;
}

.wl-select-wrap .wl-select-arrow {
  position: absolute;
  inset-inline-end: 14px;
  pointer-events: none;
  font-size: 0.72rem;
  color: rgba(47, 212, 255, 0.75);
}

.wl-phone-control {
  display: flex;
  align-items: center;
  border-radius: 11px;
  background: rgba(1, 10, 22, .7) !important;
  border: 1px solid rgba(90, 160, 220, .25) !important;
  height: clamp(38px, 5.2vh, 46px);
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s;
}

.wl-phone-control:focus-within {
  border-color: rgba(47, 212, 255, .8) !important;
  box-shadow: 0 0 0 3px rgba(0, 170, 255, .15), 0 0 16px rgba(0, 170, 255, .25) !important;
}

.wl-phone-control [data-register-dial-code] {
  padding: 0 14px;
  min-width: 52px;
  color: #2fd4ff;
  font-family: var(--whales-font-mono, monospace);
  font-size: 0.88rem;
  font-weight: 700;
  border-inline-end: 1px solid rgba(90, 160, 220, 0.22);
  background: rgba(0, 170, 255, 0.08);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.wl-phone-control input[type=tel] {
  flex: 1;
  height: 100% !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 12px !important;
  color: #fff !important;
  font-family: var(--whales-font-mono, monospace);
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  outline: 0 !important;
}

/* Symmetrical 2-Column Password Row */
.wl-password-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  width: 100% !important;
}

.wl-password-row .field {
  min-width: 0 !important;
}

.wl-password-hint-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  color: rgba(200, 225, 245, 0.65);
  margin-top: -3px;
  padding: 0 2px;
}

.wl-password-hint-pill i {
  color: #2fd4ff;
  font-size: 0.75rem;
}

.wl-approval-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(0, 170, 255, 0.06);
  border: 1px solid rgba(0, 174, 255, 0.2);
  font-size: 0.78rem;
  color: rgba(200, 225, 245, 0.85);
  line-height: 1.4;
  margin-top: 1px;
}

.wl-approval-strip svg,
.wl-approval-strip i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #2fd4ff;
  margin-top: 2px;
}

.wl-approval-strip strong {
  color: #fff;
  display: block;
  margin-bottom: 2px;
  font-size: 0.82rem;
}

.wl-approval-strip p {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(200, 225, 245, 0.7);
}

/* Registration-specific ergonomic refinements */
.wl-card--register .wl-logo {
  margin-bottom: clamp(2px, 0.8vh, 6px);
}

.wl-card--register .wl-logo img {
  height: clamp(34px, 4.8vh, 46px);
}

.wl-card--register h1 {
  font-size: clamp(1.18rem, 2.2vh, 1.38rem);
}

.wl-card--register .wl-hint {
  margin: 2px 0 clamp(6px, 1.2vh, 10px);
  font-size: 0.78rem;
}

.wl-card--register form#auth-form {
  gap: clamp(6px, 1vh, 9px) !important;
}

.wl-card--register .field label {
  margin-bottom: 2px;
  font-size: 0.75rem;
}

.wl-card--register .field input[type=email],
.wl-card--register .field input[type=password],
.wl-card--register .field input[type=text],
.wl-card--register .field input[type=tel],
.wl-card--register .wl-select-wrap select,
.wl-card--register .wl-phone-control {
  height: clamp(34px, 4.4vh, 40px) !important;
}

.wl-card--register .wl-password-row {
  gap: 8px !important;
}

.wl-card--register .wl-approval-strip {
  padding: 6px 12px;
  font-size: 0.74rem;
  line-height: 1.3;
}

.wl-card--register .wl-approval-strip strong {
  font-size: 0.77rem;
  margin-bottom: 1px;
}

.wl-card--register .wl-approval-strip p {
  font-size: 0.7rem;
}

.wl-card--register button[type=submit] {
  height: clamp(36px, 4.8vh, 42px);
  font-size: 0.9rem;
}

.wl-card--register .wl-divider {
  margin: clamp(5px, 0.9vh, 9px) 0;
}

/* ==========================================================================
   BOTTOMBAR: Sleek Institutional Telemetry Line (No cards, pure text)
   ========================================================================== */
.wl-bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3.5vw, 44px);
  pointer-events: none;
  background: linear-gradient(0deg, rgba(2, 8, 18, 0.85) 0%, rgba(2, 8, 18, 0) 100%);
  font-size: 0.7rem;
  color: rgba(180, 210, 235, 0.6);
  font-family: var(--whales-font-mono, monospace);
  letter-spacing: 0.05em;
  box-sizing: border-box;
}

.wl-telemetry-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wl-dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: wl-breathe 2.5s ease-in-out infinite;
}

.wl-system-badge {
  color: rgba(0, 229, 255, 0.75);
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */
@media (max-width: 580px) {
  .wl-password-row {
    grid-template-columns: 1fr !important;
  }
  .wl-card--register {
    width: 100%;
  }
  .wl-bottombar {
    display: none;
  }
  .wl-brand-tag {
    display: none;
  }
}

@media (max-height: 700px) { 
  .wl-logo img { height: 36px; } 
  .wl-divider { margin: 6px 0; } 
}

@media (prefers-reduced-motion: reduce) {
  .wl-beam, .wl-card, .wl-logo img, .wl-card button[type=submit]::after, .wl-ambient-aura, .wl-dot-live, .wl-radar-rings { 
    animation: none; 
  }
  .wl-bg-video {
    display: none;
  }
}
